package com.kfm.coll;

public class Computer {

    public void insert(IUsb usb) {
        usb.usb("风扇");
    }
}

class ComputerTest {

    public static void main(String[] args) {
        Computer computer = new Computer();
        IUsb usb = new IUsb() {
            @Override
            public void usb(String name) {
                System.out.println(name + "开始工作了");
            }
        };
        // class Niming implements IUsb {}
        IUsb u = name -> System.out.println(name + "开始工作了");
        computer.insert(u);
    }
}
